<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			li {
				list-style-type: none;
				height: 30px;
				border: 1px solid orange;
			}
		</style>
	</head>
	<body>
		<ul>
			<li>HTML</li>
			<li>CSS</li>
			<li>JS</li>
		</ul>
		<a href="https://www.atstudy.com/">学掌门</a>
		<form action="1获取.html">
			<button type="button">提交</button>
		</form>
		<script type="text/javascript">
			var li = document.querySelector('li');
			li.addEventListener('click', function(e) {
				console.log("ab");
				// console.dir(e);
				// console.log(e.type);
				e.stopPropagation(); //阻止冒泡
			})

			var ul = document.querySelector('ul');
			ul.addEventListener('click', function(e) {
				// console.log('ul');
				console.log(e.target); //触发是的标签
			})

			var a = document.querySelector('a');
			a.addEventListener('click', function(e) {
				e.preventDefault(); //阻止默认行为
				console.log("学掌门");
			})
		</script>
	</body>
</html>
